package com.cwj.vm;

import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;

/**
 * @author chenwujie
 * @date 2021-03-08 14:53
 *
 * 查看当前JDK是否支持八字节 Lock Free CAS操作
 */
public class LongTest {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        Field declaredField = AtomicLong.class.getDeclaredField("VM_SUPPORTS_LONG_CAS");

        declaredField.setAccessible(true);
        Object o = declaredField.get(null);
        System.out.println(o);

        List<Integer> list = Arrays.asList(1, 2,3);
    }
}
